# -*- coding: utf-8 -*-
#
# File: CalOvertime.py
#
# Copyright (c) 2008 by []
# Generator: ArchGenXML Version 2.0
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """unknown <unknown>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces
from Products.NetsightCal.content.CalShared import CalShared
from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.NetsightCal.config import *

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='employee',
        widget=StringField._properties['widget'](
            label="Employee",
            label_msgid='NetsightCal_label_employee',
            i18n_domain='NetsightCal',
        ),
        required=1,
    ),
    BooleanField(
        name='approved',
        widget=BooleanField._properties['widget'](
            label="Approved",
            label_msgid='NetsightCal_label_approved',
            i18n_domain='NetsightCal',
        ),
    ),
    StringField(
        name='title',
        widget=StringField._properties['widget'](
            visible=0,
            label='Title',
            label_msgid='NetsightCal_label_title',
            i18n_domain='NetsightCal',
        ),
    ),
),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

CalOvertime_schema = BaseSchema.copy() + \
    getattr(CalShared, 'schema', Schema(())).copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class CalOvertime(BaseContent, CalShared, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()
    implements(interfaces.ICalOvertime)

    meta_type = 'CalOvertime'
    _at_rename_after_creation = True

    schema = CalOvertime_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods

    # Manually created methods

    def Title(self):
        """Define the title as name and start day"""
        title = ''
        if self.getEmployee():
            title = self.getEmployee()
        else:
            title = 'Overtime'
        return title


registerType(CalOvertime, PROJECTNAME)
# end of class CalOvertime

##code-section module-footer #fill in your manual code here
##/code-section module-footer



